package com.zj.ssm.controller;

import com.zj.ssm.pojo.domain.query.NewsBsscQuery;
import com.zj.ssm.pojo.domain.query.NewsQuery;
import com.zj.ssm.result.AjaxResult;
import com.zj.ssm.service.NewsBsscService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wxr
 * @version 1.0
 * @date 2022/1/17 14:05
 */
@RestController
@RequestMapping("view")
public class NewsBsscConteoller {
    @Autowired
    private NewsBsscService newsBsscService;

    @RequestMapping("queryBssc")
    public AjaxResult queryBssc(NewsBsscQuery query){
        return newsBsscService.NewsBsscQuery(query);
    }

    @RequestMapping("delete/{id}")
    public AjaxResult delete(@PathVariable("id") Integer id){
        return newsBsscService.deleteNews(id);
    }

    @RequestMapping("getZhi/{id}")
    public AjaxResult getZhi(@PathVariable("id") Integer id){
        return newsBsscService.getZhi(id);
    }
    @RequestMapping("getXia/{id}")
    public AjaxResult getXia(@PathVariable("id") Integer id){
        return newsBsscService.getXia(id);
    }

    @RequestMapping("getShang/{id}")
    public AjaxResult getShang(@PathVariable("id") Integer id){
        return newsBsscService.getShang(id);
    }
}
